#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cstring>
#define endl "\n"
using namespace std;
int main()
{
	int N, n, a[10],min=0x3f3f,k,mun=1;
	cin >> N;
	while (N--)
	{
		cin >> n;
		mun=1;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
			if (min > a[i])
			{
				min = a[i];
				k = i;
			}
		}
		a[k] = a[k] + 1;
		for (int i = 0; i < n; i++)
		{
			mun *= a[i];
		}
		cout << mun << endl;
	}
	return 0;
}